<?php
/**
 * Created by PhpStorm.
 * User: wodrow
 * Date: 18-7-29
 * Time: 上午9:38
 */

namespace common\models\db;

/**
 * Class Yii2App
 * @package common\models\db
 *
 * @property Action[] $actions
 * @property User $createdBy
 * @property Menu[] $menus
 */
class Yii2App extends \common\models\db\tables\Yii2App
{
    /**
     * @return \yii\db\ActiveQuery
     */
    public function getActions()
    {
        return $this->hasMany(Action::className(), ['yii2_app_id' => 'id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getCreatedBy()
    {
        return $this->hasOne(User::className(), ['id' => 'created_by']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getMenus()
    {
        return $this->hasMany(Menu::className(), ['yii2_app_id' => 'id']);
    }
}